package com.ycp.erp.role.ui.binder;

import android.view.View;
import android.widget.TextView;

import com.one.common.config.RouterPath;
import com.one.common.manager.RouterManager;
import com.one.common.view.multitytype.adapter.BaseItemBinder;
import com.one.common.view.multitytype.adapter.BaseViewHolderMulti;
import com.ycp.erp.R;
import com.ycp.erp.role.model.bean.Role;

import androidx.annotation.NonNull;

/**
 * Class Des:
 * Created by bjh on 2021/9/14.
 */
public class RoleManagerBinder extends BaseItemBinder<Role> {

    public RoleManagerBinder() {
        super(R.layout.item_role_manager);
    }

    @Override
    protected void bindView(@NonNull BaseViewHolderMulti holder, @NonNull Role item) {
        TextView tvCircleName = holder.getView(R.id.tvCircleName);
        TextView tvName = holder.getView(R.id.tvName);
        TextView tvNo = holder.getView(R.id.tvNo);
        tvCircleName.setText(item.getFirstName());
        tvName.setText(item.getName());
        tvNo.setText("ROLE_STAFF_"+item.getRolePhone());
        holder.getView(R.id.tvDist).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RouterManager.getInstance().go(RouterPath.ROLE_DISTRIBUTE_PERMISSION);
            }
        });
    }
}
